var t = function(t) {
    return t && t.__esModule ? t : {
      default: t
    };
}(require("../../../../utils/toot.js")),
  a = getApp();

Page({
  data: {
    myDcoBoo: !1,
    modelBoo: !1,
    backBoo: !1,
    authState: null,
    lookOverBoo: 1,
    url: "team/sign/info/",
    doctor:{
      teamHeaderUrl: '/assets/images/796.png',
      teamName:'小明',
      doctorName:'老三',
      nmHospital:123,
      patientCount:1000,
      askNum:3000,
      teamDesc:'专业拔牙30年',
      teamType:2,
      doctorCount:10,
      bgGoodAt: ['骨科', '牙科', '大脑'],
      briefIntroduce: '专业治病20年'
    },
    service: [
      {
        cdInterroga: '290101',
        currentPrice: 5000,
        servicePrice: 3000
      },
      {
        cdInterroga: '290102',
        currentPrice: 5000,
        servicePrice: 3000
      },
      {
        cdInterroga: '290103',
        currentPrice: 5000,
        servicePrice: 3000
      },
      {
        cdInterroga: '290104',
        currentPrice: 5000,
        servicePrice: 3000
      }
    ],
    relation: {
      signState: 1,
      signId: 0
    },
    // myDcoBoo:123
    reasonList: ['技术菜', '收费高', '不回信息'],
    service: [{
      cdInterroga: 290101,
      currentPrice: 1000,
      servicePrice: 2000
    },
    {
      cdInterroga: 290102,
      currentPrice: 1000,
      servicePrice: 2000
    },
    {
      cdInterroga: 290103,
      currentPrice: 1000,
      servicePrice: 2000
    },
    {
      cdInterroga: 290104,
      currentPrice: 1000,
      servicePrice: 2000
    },
    ],
    options: 0,
    works: [{
      title: '说说怎么预防感冒',
      tiem: '50',
      money: ''
    },
    {
      title: '说说怎么预防感冒',
      tiem: '50',
      money: '50'
    },
    {
      title: '说说怎么预防感冒',
      tiem: '50',
      money: '10'
    },
    {
      title: '说说怎么预防感冒',
      tiem: '50',
      money: '80'
    },
    {
      title: '说说怎么预防感冒',
      tiem: '50',
      money: '50'
    },
    {
      title: '说说怎么预防感冒',
      tiem: '50',
      money: '10'
    },
    {
      title: '说说怎么预防感冒',
      tiem: '50',
      money: '80'
    }
    ],
    servicePackage: [{
      title: '手术快约',
      state: 0
    },
    {
      title: '手术快约',
      state: 1
    },
    {
      title: '手术快约',
      state: 0
    }
    ],
    specialService: [{
      effect: 80,
      satisfied: 60,
      about: 200,
      title: '换骨头方案'
    },
    {
      effect: 80,
      satisfied: 60,
      about: 200,
      title: '换骨头方案'
    },
    {
      effect: 80,
      satisfied: 60,
      about: 200,
      title: '换骨头方案'
    },
    {
      effect: 80,
      satisfied: 60,
      about: 200,
      title: '换骨头方案'
    },
    {
      effect: 80,
      satisfied: 60,
      about: 200,
      title: '换骨头方案'
    }
    ]
  },
  relieveBtn: function(o) {
    var e = o.target.dataset.signid,
      n = this;
    this.setData({
      signId: e,
      ReasonFlag: !0
    })
    // , t.default.getReason(n), wx.request({
    //   url: a.globalData.patient + "patient/sign/getUnfinishedOrder",
    //   data: {
    //     token: n.data.token,
    //     doctorId: n.data.doctorId
    //   },
    //   success: function(t) {
    //     if (200 == t.data.code) {
    //       if (console.log(t), t.data.data) return void wx.showModal({
    //         title: "请先结束未完成咨询！",
    //         showCancel: !1,
    //         confirmColor: "#3b4ca9",
    //         confirmText: "取消",
    //         success: function(t) {
    //           t.confirm || t.cancel;
    //         }
    //       });
    //       n.setData({
    //         ReasonFlag: !0
    //       });
    //     }
    //   }
    // });
  },
  selectBtn: function() {
    this.setData({
      modelBoo: !0
    });
  },
  abolishBtn: function() {
    this.setData({
      modelBoo: !1
    });
  },
  signedBtn: function() {
    var a = this;
    t.default.signedBtn(a);
  },
  cancelBtn: function(a) {
    var o = a.target.dataset.signid,
      e = this;
    this.setData({
      signId: o
    }), t.default.getDoctor(e);
  },
  checkboxChange: function(a) {
    var o = this;
    t.default.authorized(o, a);
  },
  onLoad: function(a) {
    var o = this;
    var bgc = wx.getStorageSync('color')
    wx.setNavigationBarColor({
      frontColor: "#ffffff",
      backgroundColor: bgc,
    })
    this.setData({
      token: wx.getStorageSync("logs"),
      doctorId: a.doctorId,
      jobType: a.jobType,
      currentPage: a.currentPage || "",
      lookOverBoo: a.lookOverBoo || 1,
      signType: a.signType || ""
    }), console.log(a), wx.showLoading({
      title: "加载中...",
      mask: !0
    }), t.default.doctorIntro(o), t.default.authState(o);
  },
  goInquiry: function() {
    var t = this;
    wx.navigateTo({
      url: "/hyb_yl/userCommunicate/pages/healthConsultant/healthConsultant"
    });
    // if (0 != t.data.doctor.activeFlag) wx.request({
    //   url: a.globalData.patient + "patient/sign/getCost/" + t.data.doctorId + "/" + t.data.relation.signId,
    //   success: function(a) {
    //     if (console.log(a), 10020112 != a.data.code) {
    //       if (200 == a.data.code) {
    //         if (wx.setStorageSync("costData", a.data.data), 1 == t.data.currentPage) return void wx.navigateBack({
    //           delta: 1
    //         });
    //         if (0 == t.data.dpMedOrder.status && t.data.dpMedOrder.doctorId == t.data.doctorId) return void wx.navigateTo({
    //           url: "/hyb_yl/userCommunicate/pages/groupChat/groupChat?doctorId=" + t.data.dpMedOrder.doctorId + "&sessionId=" + t.data.dpMedOrder.orderId + "&patientId=" + t.data.dpMedOrder.patientId + "&signType=" + t.data.signType
    //         });
    //         wx.navigateTo({
    //           url: "/hyb_yl/userCommunicate/pages/healthConsultant/healthConsultant?signId=" + t.data.relation.signId + "&doctorId=" + t.data.doctor.teamId + "&signType=" + t.data.signType
    //         }), console.log(t.data.cost);
    //       }
    //     } else wx.showModal({
    //       title: "抱歉团队已解散",
    //       showCancel: !1,
    //       confirmText: "我知道了",
    //       confirmColor: "#3b4ca9",
    //       success: function(t) {
    //         t.confirm && wx.switchTab({
    //           url: "/pages/index/index"
    //         });
    //       }
    //     });
    //   }
    // });
    // else {
    //   var o = t.data.doctor.stopMedNotify || "";
    //   wx.showModal({
    //     title: "停诊中",
    //     content: o,
    //     showCancel: !1,
    //     confirmText: "取消",
    //     confirmColor: "#3b4ca9"
    //   });
    // }
  },
  onReady: function() {},
  onShow: function() {
    var t = wx.getStorageSync("myTeam");
    this.setData({
      dpMedOrder: t.dpMedOrder || ""
    });
  },
  onHide: function() {},
  onUnload: function() {},
  onPullDownRefresh: function() {},
  onReachBottom: function() {},
  onShareAppMessage: function() {},
  confirmBtn: function(a) {
    var o = this;
    // this.data.reasonIndex && this.data.reasonText ? t.default.relieve(o) : wx.showToast({
    //   title: "请选择解约原因",
    //   icon: "none",
    //   duration: 2e3
    // });
  },
  offBtn: function() {
    this.setData({
      ReasonFlag: !1
    });
  },
  chooseReason: function(t) {
    console.log(t), this.setData({
      reasonIndex: t.target.dataset.disreason,
      reasonText: t.target.dataset.text
    });
  },
  Select: function (a) {
    console.log(a)
    let that = this;
    let aaa = Number(a.target.dataset.current);
    this.setData({
      options: aaa
    });
  }
});